package com.guigu.service.impl;

import com.guigu.entity.Menu;
import com.guigu.mapper.MenuMapper;
import com.guigu.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class MenuServiceImpl implements MenuService {


    @Autowired
    private MenuMapper menuMapper;
    @Override
    public List<Menu> queryMenu() {
        return this.menuMapper.queryMenu();
    }

    @Override
    public void addMenu(Menu menu) {
         this.menuMapper.addMenu(menu);

    }

    @Override
    public void updateMenu(Menu menu) {
        this.menuMapper.updateMenu(menu);
    }

    @Override
    public Menu ByIdMenu(int id) {
        return this.menuMapper.ByIdMenu(id);
    }

    @Override
    public void deleteMenu(int id) {
        this.menuMapper.deleteMenu(id);
    }


}
